// typescript中使用:指定类型
// function sayHello(person: String){
//     return 'Hello,'+person
// }
// let user = 'Tom'
// console.log(sayHello(user))
// interface Person{
//     firstName: string;
//     lastName: string
// }
// function greeter(person: Person){
//     return "Hello, "+person.firstName+" "+person.lastName
// }
// let user = {firstName: "Jane", lastName: "User"}
// console.log(greeter(user))
var Student = /** @class */ (function () {
    // 构造函数使用 public 等同于创建了同名的成员变量
    function Student(firstName, middleInitial, lastName) {
        this.firstName = firstName;
        this.middleInitial = middleInitial;
        this.lastName = lastName;
        this.fullName = firstName + " " + middleInitial + " " + lastName;
    }
    return Student;
}());
function greeter(person) {
    return "Hello, " + person.firstName + " " + person.lastName;
}
var user = new Student("Jane", "M.", "User");
console.log(greeter(user));
